package com.boot.project.core.exception;


import com.boot.project.core.enums.code.BaseCode;

public class CustomerException extends RuntimeException {

	private BaseCode baseCode;

	public BaseCode getResultCode() {
		return baseCode;
	}

	/**
	 * 没有特定信息时，使用枚举中的信息给message赋值
	 * @param baseCode 错误代码
	 */
	public CustomerException(BaseCode baseCode) {
		super(baseCode.message());
		this.baseCode = baseCode;
	}

	/**
	 * 有特定信息时，使用特定信息给message赋值
	 * @param baseCode 错误代码
	 * @param msg 自定义信息
	 */
	public CustomerException(BaseCode baseCode, String msg) {
		super(msg);
		this.baseCode = baseCode;
	}

}
